/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"6AB23843-5AA5-47B0-9599-B45BD3C53E71",variableType:8}
 */
var f_importe_desde = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"B52D3BA0-3EA9-4005-925B-14028B81A3D8",variableType:8}
 */
var f_importe_hasta = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"DA6E1457-6018-4478-99E0-EF028DB6D46D"}
 */
function Ira_detalle(event) {
	globals.mostrarForm("rec_detalle");
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"29A93B87-C74D-4ABE-B745-160A06229189"}
 * @AllowToRunInFind
 */
function buscar(firstShow, event)  //14/09/2010
{
	databaseManager.revertEditedRecords();
	databaseManager.setAutoSave(true);
	 
	var estado_find=controller.find()
	if (estado_find==false)
	{
		globals.DIALOGS.showWarningDialog('Aviso',"No encontró Recibos (1º find)",'OK');	
		return false;
	}
	codigo_movimiento='=1||^'  // quiere decir  =1 o null
	//12/10/2010  desde
	if (globals.gClienteDesde!=null)
		{
		cliente_id=globals.gClienteDesde;
		}
	if (globals.gFechaDesde!=null)
		{
		var d1 = globals.gFechaDesde
		d1.setHours(00);
		d1.setMinutes(00);
		d1.setSeconds(00);             
		var df1 = utils.dateFormat(d1, 'dd-MM-yyyy HH:mm:ss')
		var d2 = globals.gFechaHasta
		d2.setHours(23);
		d2.setMinutes(59);
		d2.setSeconds(59);
		var df2 = utils.dateFormat(d2, 'dd-MM-yyyy HH:mm:ss');
		fecha=df1+'...' + df2+'|dd-MM-yyyy HH:mm:ss';	
		}
	
	if (f_importe_desde!=null)	
	{
		importe=f_importe_desde+'...' +f_importe_hasta;
	}		 
	// 12/10/2010  hasta
	var found = controller.search()
	if (found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No se encontraron recibos con esas condiciones','OK');
	}
	else
	{
		foundset.sort('fecha desc, letra desc, sucural desc ,nro_comprobante desc');
	}
	return true
}

/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"3E679FF0-0C14-4B20-9647-60A67066E466"}
 */
function onDataChange_f_importe_desde(oldValue, newValue, event) 
{
	if (f_importe_hasta == null || f_importe_hasta < f_importe_desde)
		f_importe_hasta = f_importe_desde;
	return true
}
